<html>
<head>
<script src=@{'public/js/jquery-1.3.min.js'}></script>
<script> 
$(document).ready(function() {
	
	$(":checkbox").click(function(){
		
		
		if($(this).attr("checked")==true) 
			$(this).val("true");
		else
			$(this).val("false");
	});
	
});

</script>
<style>

body{
font-family: calibri;
}

form  {
margin-left: auto;
margin-right: auto;
position:relative;
top:5em;
width: 16em;
border: solid 1px gray;
padding: 1em;

}
form p input {
float: right;
}

.button {
display: block;
width: 100px;
height: 30px;
color:#666666;
text-decoration: none;
float:none;
width: 70%;
margin-left:auto;
margin-right: auto;
}


</style>

</head>


<body>
<h2>Permissions for ${user.getfName()} ${user.getlName()} (${user.getUsername()} In Entity: ${entity.getName()})</h2>

<form action=@{Roles.editRoleInEntity()}>

<input type="hidden" value=${user.id} name="userId"/>
<input type="hidden" value=${entity.id} name="entityId"/>
<p>The user can:</p>
<hr>
<p>
<p>Edit: <input type="checkbox" value=${role.isCanEdit()} #{if role.isCanEdit()} checked="checked" #{/if}  name="canEdit" id="canEdit" /></p>
<p>Post: <input type="checkbox" value=${role.isCanPost()} #{if role.isCanPost()} checked="checked" #{/if}  name="canPost" id="canPost" /></p>
<p>Delete:  <input type="checkbox" value=${role.isCanDelete()} #{if role.isCanDelete()} checked="checked" #{/if} name="canDelete" id="canDelete" /></p>
<p>Create Organization:  <input type="checkbox"  #{if role.isCanCreateOrganisation()} checked="checked" #{/if} name="canCreateOrganisation" id="CreateOrganisation" /></p>
<p>Invite: <input type="checkbox" value=${role.isCanInvite()} #{if role.isCanInvite()} checked="checked" #{/if} name="canInvite" id="canInvite" /></p>
<p>Administer Topic: <input type="checkbox" value=${role.isCanAdministerTopic()} #{if role.isCanAdministerTopic()} checked="checked" #{/if} name="canAdministerTopic" id="canAdministerTopic" /></p>
<p>Be Restricted: <input type="checkbox" value=${role.isCanBeRestricted()} #{if role.isCanBeRestricted()} checked="checked" #{/if} name="canBeRestricted" id="canBeRestricted" /></p>
<p>Administer Entity: <input type="checkbox" value=${role.isCanAdministerEntity()} #{if role.isCanAdministerEntity()} checked="checked" #{/if} name="canAdministerEntity" id="canAdministerEntity" /></p>
<hr>
<p><input class="button" type="submit" value="Submit"></p>

</form>

</body>
</html>